/*
 * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <tencentcloud/tsf/v20180326/model/AdvanceSettings.h>

using TencentCloud::CoreInternalOutcome;
using namespace TencentCloud::Tsf::V20180326::Model;
using namespace rapidjson;
using namespace std;

AdvanceSettings::AdvanceSettings() :
    m_subTaskConcurrencyHasBeenSet(false)
{
}

CoreInternalOutcome AdvanceSettings::Deserialize(const Value &value)
{
    string requestId = "";


    if (value.HasMember("SubTaskConcurrency") && !value["SubTaskConcurrency"].IsNull())
    {
        if (!value["SubTaskConcurrency"].IsInt64())
        {
            return CoreInternalOutcome(Error("response `AdvanceSettings.SubTaskConcurrency` IsInt64=false incorrectly").SetRequestId(requestId));
        }
        m_subTaskConcurrency = value["SubTaskConcurrency"].GetInt64();
        m_subTaskConcurrencyHasBeenSet = true;
    }


    return CoreInternalOutcome(true);
}

void AdvanceSettings::ToJsonObject(Value &value, Document::AllocatorType& allocator) const
{

    if (m_subTaskConcurrencyHasBeenSet)
    {
        Value iKey(kStringType);
        string key = "SubTaskConcurrency";
        iKey.SetString(key.c_str(), allocator);
        value.AddMember(iKey, m_subTaskConcurrency, allocator);
    }

}


int64_t AdvanceSettings::GetSubTaskConcurrency() const
{
    return m_subTaskConcurrency;
}

void AdvanceSettings::SetSubTaskConcurrency(const int64_t& _subTaskConcurrency)
{
    m_subTaskConcurrency = _subTaskConcurrency;
    m_subTaskConcurrencyHasBeenSet = true;
}

bool AdvanceSettings::SubTaskConcurrencyHasBeenSet() const
{
    return m_subTaskConcurrencyHasBeenSet;
}

